const Controller = require("egg").Controller

class BaseController extends Controller {
  Success(data = {}) {
    const { ctx, app } = this
    ctx.body = {
      code: 200,
      data,
    }
  }
  Error(errMsg = "") {
    const { ctx, app } = this
    ctx.body = {
      code: 500,
      errMsg,
    }
  }
}

module.exports = BaseController
